package request

import (
	"gorm.io/gorm"
	"time"
)

type CompanyRequest struct {
	ID                 int64              `json:"id" validate:"required" validate:"required"`
	CreatedAt          time.Time          `json:"created_at" validate:"required"`
	UpdatedAt          time.Time          `json:"updated_at" validate:"required"`
	DeletedAt          gorm.DeletedAt     `json:"deleted_at" validate:"required"`
	UnionNumber        string             `json:"union_number" validate:"required"`
	CompanyName        string             ` json:"company_name" validate:"required"`         // 企业名称
	CompanyType        string             ` json:"company_type" validate:"required"`         // 企业类型：1.机构2门店
	RegisteredCapital  string             ` json:"registered_capital" validate:"required"`   // 注册资金
	BusinessCategory   int64              ` json:"business_category" validate:"required"`    // 经济类型：1. 私营，2.个体，3联营，4股份制，5外商投资，6港澳台投资，7其它
	BusinessType       int64              `json:"business_type" validate:"required"`         // 经营方式：1.零售，2批发，3生产
	CompanyAddress     string             `json:"company_address" validate:"required"`       // 公司地址
	OwnerName          string             ` json:"owner_name" validate:"required"`           // 法人
	ManagerName        string             ` json:"manager_name" validate:"required"`         // 公司负责人
	OpeningBankName    string             ` json:"opening_bank_name" validate:"required"`    // 开户行
	OpeningAccountName string             ` json:"opening_account_name" validate:"required"` // 开户户名
	OpeningAccount     string             ` json:"opening_account" validate:"required"`      // 开户账号
	IsInsurance        int64              ` json:"is_insurance" validate:"required"`         // 是否是医保药店
	TelephoneNumber    string             ` json:"telephone_number" validate:"required"`     // 座机号
	FaxNumber          string             ` json:"fax_number" validate:"required"`           // 传真号
	CompanyEmail       string             ` json:"company_email" validate:"required"`        // 公司邮箱
	Website            string             ` json:"website" validate:"required"`              // 公司站点
	PostalCode         string             ` json:"postal_code" validate:"required"`          // 邮编
	BusinessScope      string             ` json:"business_scope" validate:"required"`       // 经营范围
	UUID               string             ` json:"uuid" validate:"required"`                 // 统一账号uuid
	Avatar             string             ` json:"avatar" validate:"required"`
	Companycerts       companycertRequest `json:"companycerts"`
	Workflows          []workflow         `json:"workflows"`
	BusinessItemArray  []string           `json:"business_item_array"`
	BusinessScopeArray []string           `json:"business_scope_array"`
}

type companycertRequest struct {
	ID         int64     `json:"id" validate:"required"`
	CompanyId  string    `json:"company_id" gorm:"type:varchar" validate:"required"`
	CertName   string    `json:"cert_name" validate:"required"`
	CertNumber string    `json:"cert_number" validate:"required"`
	Indate     string    `json:"indate" validate:"required"`
	CreatedAt  time.Time `json:"created_at" validate:"required"`
	UpdatedAt  time.Time `json:"updated_at" validate:"required"`
	File       file      `json:"file"`
}
type file struct {
	ID       int64  `json:"id"  validate:"required"`
	url      int64  `json:"company_id"  validate:"required"`
	fileName string `json:"Fileame" gorm:"type:varchar" validate:"required"`
}

type workflow struct {
	ID           int64     `json:"id" gorm:"type:varchar" validate:"required"`
	tag          string    `json:"tag" gorm:"type:varchar" validate:"required"`
	modelType    string    `json:"model_type" gorm:"type:varchar" validate:"required"`
	modelId      string    `json:"model_id" validate:"required"`
	title        string    `json:"title" gorm:"type:varchar" validate:"required"`
	content      string    `json:"content" gorm:"type:varchar" validate:"required"`
	currentPlace string    `json:"current_place" gorm:"type:varchar" validate:"required"`
	effectField  string    `json:"effect_field" gorm:"type:varchar" validate:"required"`
	extra        string    `json:"extra" gorm:"type:varchar" validate:"required"`
	createdAt    time.Time `json:"created_at" validate:"required"`
	updatedAt    time.Time `json:"updated_at" validate:"required"`
}
